//
//  TFVoteSelectImgviewCell.swift
//  TalkfunSDKDemo
//
//  Created by 邓盛明 on 2022/2/18.
//  Copyright © 2022 Talkfun. All rights reserved.
//

import UIKit

class TFVoteSelectImgviewCell: UITableViewCell {
    @objc public var bgview:UIView!
    @objc public var cellWidth:CGFloat = 0.0
    @objc public var imageUrlView:UIImageView!
 
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.backgroundColor = UIColor.clear
        self.bgview = UIView.init()
        self.bgview.layer.masksToBounds = true
        self.bgview.layer.cornerRadius = 4;
        self.bgview.backgroundColor = UIColor.white
        self.contentView.addSubview(self.bgview)
        self.imageUrlView = UIImageView.init()
        self.bgview.addSubview(self.imageUrlView)
        self.imageUrlView.contentMode = .scaleAspectFit
    
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.bgview.frame = CGRect(x: 24, y: 0, width: self.cellWidth-48, height: self.frame.size.height)
        
        self.imageUrlView.frame = CGRect(x: 0, y: 0, width: self.bgview.frame.size.width, height: self.bgview.frame.size.height)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
